print("类型测试")

# 变量定义
x = 10          # 整数
y = 3.14         # 浮点数
name = "Alice"   # 字符串
is_active = True # 布尔值

# 多变量赋值
a, b, c = 1, 2, "three"

# 查看数据类型
print(type(x))        # <class 'int'>
print(type(y))        # <class 'float'>
print(type(name))     # <class 'str'>
print(type(is_active)) # <class 'bool'>


a, b, c, d = 20, 5.5, True, 4+3j
print(type(a), type(b), type(c), type(d))
# <class 'int'> <class 'float'> <class 'bool'> <class 'complex'>

a = 111
print(isinstance(a, int)) # True

class A:
    pass
class B(A):
    pass
print(isinstance(A(), A)) # True
print(type(A()) == A ) # True
print(isinstance(A(), B)) # False

print(isinstance(B(), A)) # True
print(type(B()) == B ) # True
print(type(B()) == A ) # False